fix: repair cross-package bugs to make all tests pass - #92
Open
stooit wants to merge 1 commit into
Open
Conversation
- utils: rename stale useThrottle import to useDebounce in apps/web api - ui/Button: forward aria-* and passthrough props to <button>; provide fallback accessible name for icon-only buttons - ui/DataTable: use functional setState updater to fix stale-closure sort - utils/date: use day:"numeric" en-AU format (normalise ICU zero-pad) - tsconfig: add bun-types and include app tests so all sources type-check All 13 tests pass; tsc --noEmit clean.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the four cross-package bugs in the monorepo so all tests pass and
tsc --noEmitis clean. No test files modified, no dependencies added.Fixes
apps/web/src/lib/api.tsimported the old hook nameuseThrottle, which was renamed touseDebounceinpackages/utils. Updated the import to resolve.aria-*/ passthrough props. Now extendsReact.ButtonHTMLAttributes<HTMLButtonElement>and spreads...restonto<button>, so the caller'saria-labelreaches the element. Icon-only buttons get a fallback accessible name when none is supplied (a test renders an icon-only button with noaria-labeland asserts the attribute is non-null).sortDirfrom the closure. Switched to a functionalsetSortDir(prev => ...)updater so a second click correctly sorts descending.formatDatenow usesday: "numeric"(en-AU) so single-digit days render without a confusing leading zero, matching the test's/^1/expectation for 1 March 2024.bun-types(test globals) and includedapps/*/test/**/*so app tests are type-checked too.strict: trueandskipLibCheckunchanged — this tightens coverage, it does not loosen type safety.Assumptions / Notes
formatDateretains a normalisation step for the day field: Bun's bundled ICU (v73) zero-padsen-AUdays regardless ofday: "numeric"vs2-digit(permitted ECMA-402 implementation latitude). The format option is now semantically correct (numeric); the normalisation compensates for the runtime's ICU behaviour so output is stable across environments.aria-labelwhen none is passed; callers passing their ownaria-labelalways win.Verification
bun test packages/utils/test packages/ui/test apps/web/test --preload ./packages/ui/test/setup.ts→ 13 pass, 0 failnode_modules/.bin/tsc --noEmit→ clean (exit 0)